import { SkillModule } from "../../../../../modules/SkillModule";
import { Language } from "../../../../../extend/language/Language";
import { CareerConfig } from "../../../resource/CareerConfig";
import { SkillCareerPanel } from "../../skill/career/SkillCareerPanel";
import { SkillCareerGradePanel } from "../../skill/career/SkillCareerGradePanel";
import { Cache } from "../../../cache/Cache";
type int = number;
//class SkillQuickView
    
    export  class SkillQuickView extends SkillModule
    {
        constructor()
        {
            super();
            this._careerSkillIndex = [16, 32, 64, 128];
            title = Language.getString(27516);
            this._careerSkillPanels = [this._career1SkillPanel, this._career2SkillPanel, this._career4SkillPanel, this._career8SkillPanel];
            skillTabData = [{"name":"skill1", "label": CareerConfig.instance.getInfoByCode(this._careerSkillIndex[0]).name + Language.getString(27517)}, {"name":"skill2", "label": CareerConfig.instance.getInfoByCode(this._careerSkillIndex[1]).name + Language.getString(27517)}, {"name":"skill3", "label": CareerConfig.instance.getInfoByCode(this._careerSkillIndex[2]).name + Language.getString(27517)}, {"name":"skill4", "label": CareerConfig.instance.getInfoByCode(this._careerSkillIndex[3]).name + Language.getString(27517)}];
            _tabBar.dataProvider = skillTabData;
            return;
        }

        /* internal  */addCareerPanel(arg1: int): SkillCareerPanel
        {
            var loc1=null;
            loc1 = this._careerSkillPanels[arg1];
            if (!loc1) 
            {
                loc1 = new SkillCareerGradePanel();
                loc1.x = 18;
                loc1.y = 60;
                loc1.initSkill(Cache.instance.skill.getSkillBaseInfo(this._careerSkillIndex[arg1]), false);
            }
            if (!loc1.parent) 
            {
                addChild(loc1);
            }
            return loc1;
        }

        public /* override */ changeTabBarByIndex(arg1: int): void
        {
            var loc1=null;
            _tabBar.selectedIndex = arg1;
            loc1 = this.addCareerPanel(_tabBar.selectedIndex);
            if (this._currentPanel && this._currentPanel.parent && !(this._currentPanel == loc1)) 
            {
                removeChild(this._currentPanel);
            }
            this._currentPanel = loc1;
            return;
        }

        public /* override */ changeTabBarByCareer(arg1: int): void
        {
            this.changeTabBarByIndex(this._careerSkillIndex.indexOf(arg1));
            return;
        }

        public /* override */ initSkill(arg1: Array<any>): void
        {
            if (this._currentPanel && this._currentPanel.parent) 
            {
                this._currentPanel.initSkill(arg1);
            }
            return;
        }

        protected /* override */ checkCareerOnShow(): void
        {
            return;
        }

        public /* override */ guideLevelUp(arg1: Array<any>, arg2: Boolean): void
        {
            return;
        }

        public /* override */ updateCondition(): void
        {
            return;
        }

        public /* override */ clear(): void
        {
            return;
        }

        /* internal */ /* var */_career1SkillPanel: SkillCareerPanel;

        /* internal */ /* var */_career2SkillPanel: SkillCareerPanel;

        /* internal */ /* var */_career4SkillPanel: SkillCareerPanel;

        /* internal */ /* var */_career8SkillPanel: SkillCareerPanel;

        /* internal */ /* var */_currentPanel: SkillCareerPanel;

        /* internal */ /* var */_careerSkillPanels: Array<any>;

        /* internal */ /* var */_careerSkillIndex: Array<any>;
    }
